<template>
  <div>
     <header>以下商品极速达无库存,勾选将为您切换全城配配送</header>
    <div class="item-list">
      <div class="item">
        <div class="box"><input type="checkbox" /></div>

        <div class="pic">
          <img src="" alt="" />
        </div>
        <div class="content">
          <div class="title">MM 榴莲千层蛋糕 1kg</div>
          <div class="desc">限购5件</div>
          <div class="price-info">
            <div class="price">¥128</div>
            <div class="oper">
              <button class="reduce" @click="num--" :disabled="num == 1">
                -
              </button>
              <span>{{ num }}</span>
              <button class="add" @click="num++">+</button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <mt-tabbar v-model="selected" fixed>
      <mt-tab-item id="shoye" @click.native.capture="getshoye"
        >首页
        <img
          v-if="selected == 'shoye'"
          slot="icon"
          src="../assets/shoye2.png"
        />
        <img v-else slot="icon" src="../assets/shoye1.png" />
      </mt-tab-item>
      <mt-tab-item id="fenlei" @click.native.capture="getfenlei"
        >分类
        <img
          v-if="selected == 'fenlei'"
          slot="icon"
          src="../assets/fenlei2.png"
        />
        <img v-else slot="icon" src="../assets/fenlei1.png" />
      </mt-tab-item>
      <mt-tab-item id="shopcar"
        >购物车
        <img
          v-if="selected == 'shopcar'"
          slot="icon"
          src="../assets/shopcar2.png"
        />
        <img v-else slot="icon" src="../assets/shopcar1.png" />
      </mt-tab-item>
      <mt-tab-item id="me" @click.native.capture="getme"
        >我的
        <img v-if="selected == 'me'" slot="icon" src="../assets/me2.png" />
        <img v-else slot="icon" src="../assets/me1.png" />
      </mt-tab-item>
    </mt-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      selected: "shopcar",
       num: 2,
    };
  },
  methods: {
    getfenlei() {
      this.$router.push("/myfenlei");
    },
    getshoye() {
      this.$router.push("/");
    },
    getme() {
      this.$router.push("/mymessage");
    },
  },
};
</script>

<style scoped>
header {
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
  line-height: 20px;
}
.box {
  width: 30px;
  height: 30px;
}
.box input {
  padding: 10px;
}

.item-list .item {
  padding: 15px;
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  background-color: #ededed;
}
.item-list .item .pic img {
  width: 25vw;
  height: 16vh;
}
.item-list .item .content {
  margin-left: 20px;
}
.item-list .item .content .title {
  font-size: 17px;
}
.item-list .item .content .desc {
  font-size: 10px;
  color: #999;
  width: 45px;
  text-align: center;
  border: 1px solid gray;
  background-color: aquamarine;
  border-radius: 14px;
  padding: 4px;
  margin: 10px 0 33px 0;
}
.item-list .item .content .price-info {
  display: flex;
}
.item-list .item .content .price-info .price {
  width: 100%;
  font-size: 17px;
  color: red;
  font-weight: 600;
}
.item-list .item .content .price-info .oper {
  width: 120px;
  display: flex;
  border-radius: 5px;
}
.item-list .item .content .price-info .oper .add {
  width: 25px;
  text-align: center;
  border-left: 1px solid #ccc;
}
.item-list .item .content .price-info .oper .reduce {
  width: 25px;
  text-align: center;
  border-right: solid 1px #ccc;
}
.item-list .item .content .price-info .oper span {
  width: 25px;
  text-align: center;
  font-size: 17px;
  line-height: 25px;
}
</style>